# -*- coding : utf_8 -*-
"""
=======================================
Time : 2025/4/13 19:59
Author : 田霄汉
Email : 522989570@qq.com
File : combat_class15.py
Project : pandas_demo
Function : 数据拆分
=======================================
"""
import pandas as pd
from config.setting import file_path

combat15_path = file_path['excel_path'] + '/combat15.xlsx'
Employees_df = pd.read_excel(io=combat15_path,
                             skiprows=3,
                             usecols='C:D',
                             index_col='id')
# 使用split()可以将字符串进行拆分
# 使用expand=True可以直接将拆分的结果填充到不同列中，n=2表示最多拆分2部分结果出来
FullName_series = Employees_df['Full Name'].str.split(n=2, expand=True)
Employees_df['First Name'] = FullName_series[0]
Employees_df['Last Name'] = FullName_series[1]
print(Employees_df)
